home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Stone Design
/
Stone Design.iso
/
Stone_Friends
/
Wave
/
WavesWorld
/
Source
/
IBPalettes
/
WW3DKit
/
smoothst.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1995-03-22
|
218 b
|
13 lines
#include "proctext.h"
float
smoothstep(float a, float b, float x)
{
if (x < a)
return 0;
if (x >= b)
return 1;
x = (x - a)/(b - a); /* normalize to [0:1] */
return (x*x * (3 - 2*x));
}